#include <cstdio>
#include <algorithm>
using namespace std;

int main() {
	int n;
	long long ans = 0;
	int x, last;
	scanf("%d", &n);
	scanf("%d", &last);
	for (int i = 1; i < n; ++i) {
		scanf("%d", &x);
		ans += max(last, x);
		last = x;
	}
	printf("%lld\n", ans);
	return 0;
}